#!usr/bin/env python  
# -*- coding: utf-8 -*-
""" 
@author:Simon
@file: objdemo08.py 
@time: 2018/01/18 
"""
class Student(object):

    @property
    def score(self):
        return self._score
    @score.setter
    def score(self,value):
        if not isinstance(value,int):
            raise ValueError('分数必须为整数')
        if value<0 or value >100:
            raise ValueError('score 必须为0到100')
        self._score = value

s = Student()
s.score = 99
print(s.score)

s.score = 99999